using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text;
using System.Data; 
using yq.IBase; 
using yq.Dictionary; 
using yq.Basis; 
using yq.Model.Logic;
using System.Collections; 
using Db; 
using System.Data.Common;

namespace yq.Model.Base 
{
    ///<summary>
    /// Article_Topic - 专题 - 对象基础类
    /// </summary>
    ///<typeparam name="T"></typeparam>
    public abstract class IArticleTopic<T> :ModelBase<ArticleTopic> where T : ArticleTopic, new()
    {
        /// <summary>
        /// 写入主键值
        /// </summary>
        /// <param name="Id">主键</param>
        protected internal override void SetKeyValue(dynamic Id)
        {
            this.TopicId = Id;
        }

        /// <summary>
        /// 获取主键值
        /// </summary>
        /// <returns></returns>
        protected internal override dynamic GetKeyValue()
        {
            return TopicId;
        }

        /// <summary>
        /// 为本对象赋值
        /// </summary>
        /// <param name="dy"></param>
        public override void SetValue(dynamic dy) 
        {
           this.TopicId=dy.TopicId;
           this.TopicTitle=dy.TopicTitle;
           this.FileId=dy.FileId;
           this.TxtId=dy.TxtId;
        } 

        #region 定义属性

     
         /// <summary>
        /// 专题
        /// </summary>
        private String _TopicId = "";
      
        /// <summary>
        /// 专题
        /// </summary>
        public String TopicId
        {
            get 
            {
              return   (this._TopicId); 
            }

            set 
            {
                    _TopicId= value;  
            }
        }
       
     
         /// <summary>
        /// 专题名称
        /// </summary>
        private String _TopicTitle = "";
      
        /// <summary>
        /// 专题名称
        /// </summary>
        public String TopicTitle
        {
            get 
            {
              return   (this._TopicTitle); 
            }

            set 
            {
                    _TopicTitle= value;  
            }
        }
       
     
         /// <summary>
        /// 专题图片
        /// </summary>
        private String _FileId = "";
      
        /// <summary>
        /// 专题图片
        /// </summary>
        public String FileId
        {
            get 
            {
              return   (this._FileId); 
            }

            set 
            {
                    _FileId= value;  
            }
        }
       
     
         /// <summary>
        /// 专题介绍
        /// </summary>
        private String _TxtId = "";
      
        /// <summary>
        /// 专题介绍
        /// </summary>
        public String TxtId
        {
            get 
            {
              return   (this._TxtId); 
            }

            set 
            {
                    _TxtId= value;  
            }
        }
       

      #endregion 定义属性 

          protected internal override void SetValue(ArticleTopic info, DataRow row) 
          { 
               if (row == null) 
               { 
                 info.IsLoad = false; 
               }
               else 
               { 
                  info.IsLoad = true; 
                  
                  if(row["TopicId"]!= DBNull.Value)
                  {
                  info.TopicId=row["TopicId"].ToString();
                 }
                 
                  
                  if(row["TopicTitle"]!= DBNull.Value)
                  {
                  info.TopicTitle=row["TopicTitle"].ToString();
                 }
                 
                  
                  if(row["FileId"]!= DBNull.Value)
                  {
                  info.FileId=row["FileId"].ToString();
                 }
                 
                  
                  if(row["TxtId"]!= DBNull.Value)
                  {
                  info.TxtId=row["TxtId"].ToString();
                 }
                 
               } 

          } 

        protected internal override void GetDbParameters(DbCommand comm, ArticleTopic info, DbHelper cn) 
        { 
             
                cn.AddInParameter(comm, "@TopicId", DbType.String,ParameterTool.GetObj( info._TopicId )); 
            
             
                cn.AddInParameter(comm, "@TopicTitle", DbType.String,ParameterTool.GetObj( info._TopicTitle )); 
            
             
                cn.AddInParameter(comm, "@FileId", DbType.String,ParameterTool.GetObj( info._FileId )); 
            
             
                cn.AddInParameter(comm, "@TxtId", DbType.String,ParameterTool.GetObj( info._TxtId )); 
            
        } 

    } 
} 